const API = require('../../pages/api/index')
const { typeJson } = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist'))


Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown:"",
    pullup:2,
    addButton:false,
    prolist:wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist')),
    listConfig: [
      {
        prop: "name",
        label: "姓名",
      },
      {
        prop: "post",
        label: "现任岗位",
      },
      ],

      formConfig: [
        {
          prop: "name",
          label: "姓名",
          value: "",
          required: true,
        },
        {
          prop: "sex",
          label: "性别",
          jsonType: typeJson.sex,
          type: "dropDown",
        
        },
        {
          prop: "birthday",
          label: "出生年月",
        
        },
        {
          prop: "idCard",
          label: "身份证号码",
      
        },
          {
          prop: "entryDate",
          label: "入职日期",
      
        },
        {
          prop: "workYears",
          label: "工作年限",
        },
    
   
        {
          label: "部门",
          prop: "orgName",
        },
        {
          prop: "post",
          label: "现任岗位",
        },
        {
          prop: "certificateName",
          label: "工种类型",
        },
        {
          prop: "certificateNo",
          label: "证件号码",
        },
        {
          prop: "issueOrgan",
          label: "颁发机关",
        },

        {
          prop: "issueDate",
          label: "颁发日期",
        },

        {
          prop: "trainDate",
          label: "培训时间",
        },
        {
          prop: "validity",
          label: "有效期限",
        },

        {
          prop: "reviewDate",
          label: "复审时间",
         
        },
        {
          prop: "reviewSituation",
          label: "复审情况",
        },
        {
          prop: "photo",
          label: "照片",
          type: 'image'
        },

        ],
    
        
        net: {
       
            select: {
              url: `/app/alarmRecord/getAlarmRecForSpc`,
              method: 'post',
              data: {
                mineId: true, 
              }
            },
            delete: {
              url: '',
              method: 'get',
              data: {
                
              }
            },
            insert: {
              url: '',
              method: 'post',
              data: {
              
               
              }
            },
            update: {
              url: '',
              method: 'post',
              data: {
  
              }
            }
  
          
        },
        showCom:true
      },

     
  

  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
   
    this.setData({
      showCom: false
    });
    this.setData({
      showCom: true
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

/**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.stopPullDownRefresh()
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})